package com.wolfeyes.system.service.impl;

import com.wolfeyes.system.domain.SysHall;
import com.wolfeyes.system.mapper.SysHallMapper;
import com.wolfeyes.system.service.SysHallService;
//import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;

//import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @see Talk is cheap, Show me the code. -- Linus Torvalds
 * @title 影厅（选座）信息服务层-实现类
 * @author yanyljava
 * @email yanyljava@qq.com
 * @create 2022-01-15 10:21
 */
@Service
@RequiredArgsConstructor
public class SysHallServiceImpl implements SysHallService {

	//@Autowired
	private final SysHallMapper sysHallMapper;

	@Override
	public List<SysHall> findAll(SysHall sysHall) {
		return sysHallMapper.findAll(sysHall);
	}

	@Override
	public SysHall findByCinemaIdAndHallId(SysHall sysHall) {
		return sysHallMapper.findByCinemaIdAndHallId(sysHall);
	}

	@Override
	public int add(SysHall sysHall) {
		return sysHallMapper.add(sysHall);
	}

	@Override
	public int update(SysHall sysHall) {
		return sysHallMapper.update(sysHall);
	}

	@Override
	public int delete(SysHall[] sysHalls) {
		int rows = 0;
		for (SysHall sysHall : sysHalls) {
			rows += sysHallMapper.delete(sysHall);
		}
		return rows;
	}
}
